/*
 * @Date: 2021-02-15 12:00:30
 * @LastEditors: 小枫
 * @description: 路由配置文件
 * @LastEditTime: 2021-02-15 12:05:59
 * @FilePath: \ssr\src\router\index.js
 */
import Vue from 'vue'
import Router from 'vue-router'

import About from '../pages/About'
import Index from '../pages/Index'


Vue.use(Router)

// 使用工厂函数，返回一个路由的构造器，防止污染不同访问者的路由
export default function createRouter() {
  return new Router({
    mode: 'history',
    routes: [
      { path: '/', component: Index },
      { path: '/about', component: About },
    ],
  })
}

